home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / gnu_st.lha / gnu_st / smalltalk-1.1.1 / stix / Atom.st < prev    next >
Text File  |  1991-09-12  |  3KB  |  94 lines

  1. "======================================================================
  2. |
  3. | Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  4. | Written by Steve Byrne.
  5. |
  6. | This file is part of GNU Smalltalk.
  7. |
  8. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  9. | under the terms of the GNU General Public License as published by the Free
  10. | Software Foundation; either version 1, or (at your option) any later version.
  11. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  12. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  14. | details.
  15. | You should have received a copy of the GNU General Public License along with
  16. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  17. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  18. |
  19.  ======================================================================"
  20.  
  21.  
  22. "
  23. |     Change Log
  24. | ============================================================================
  25. | Author       Date       Change 
  26. | sbyrne     24 May 90      created.
  27. |
  28. "
  29.  
  30. Object subclass: #Atom
  31.     instanceVariableNames: 'id'
  32.     classVariableNames: 'AtomNames'
  33.     poolDictionaries: ''
  34.     category: 'X window attributes'
  35. !
  36.     
  37. !Symbol methodsFor: 'Atom mapping'!
  38.  
  39. mapToId
  40.     ^(Atom symbolMap: self) mapToId
  41.  
  42. !!
  43.  
  44. !Atom class methodsFor: 'initialization'!
  45.  
  46. initialize
  47.     | names i |
  48.     AtomNames _ Dictionary new.    
  49.     names _ #(Primary Secondary Arc Atom Bitmap Cardinal Colormap Cursor CutBuffer0
  50.           CutBuffer1 CutBuffer2 CutBuffer3 CutBuffer4 CutBuffer5 CutBuffer6
  51.           CutBuffer7 Drawable Font Integer Pixmap Point Rectangle ResourceManager
  52.           RGBColorMap RGBBestMap RGBBlueMap RGBDefaultMap RGBGrayMap RGBGreenMap
  53.           RGBRedMap String Visualid Window WmCommand WmHints WmClientMachine
  54.           WmIconName WmIconSize WmName WmNormalHints WmSizeHints WmZoomHints
  55.           MemSpace NormSpace MaxSpace EndSpace SuperscriptX SuperscriptY
  56.           SubstriptX SubscriptY UnderlinePosition UnderlineThickness
  57.           StrikeoutAscent StrikeoutDescent ItalicAngle XHeight QuadWidth
  58.           Weight PointSize Resolution Copyright Notice FontName FamilyName
  59.           FullName CapHeight WmClass WmTransientFor).
  60.     i _ 1.
  61.     names do: 
  62.     [ :name | AtomNames at: name put: (Atom new: i).
  63.           i _ i + 1 ].
  64. !
  65.  
  66. new: anId
  67.     ^self new init: anId
  68. !!
  69.     
  70. !Atom class methodsFor: 'accessing'!
  71.  
  72. symbolMap: anAtomId
  73.     ^AtomNames at: anAtomId
  74. !!
  75.  
  76.  
  77. !Atom methodsFor: 'accessing'!
  78.  
  79. mapToId
  80.     ^id
  81. !!
  82.  
  83. !Atom methodsFor: 'private'!
  84.  
  85. init: anId
  86.     id _ anId
  87. !!
  88.  
  89. Atom initialize!
  90.  
  91.  
  92.